package util;

import java.util.ArrayList;

import model.Course;
import model.Score;
import model.Student;

public class PrintUtil {
	/**
	 * 打印学生列表
	 * 
	 * @param studentList
	 */
	public static void print(ArrayList<Student> studentList) {
		if (studentList == null || studentList.size() == 0) {
			System.out.println("学生列表为空");
			return;
		}

		System.out.print("ID" + "  " + "   姓名" + "   " + " 年龄" + "  " + "      班级\n");

		for (int i = 0; i < studentList.size(); i++) {
			Student student = studentList.get(i);

			System.out.print(student.getId() + "   ");
			System.out.print(student.getName() + "   ");
			System.out.print(student.getAge() + "   ");
			System.out.print(student.getClassname() + "   ");
			System.out.print("\n");
		}
	}

	/**
	 * 打印菜单
	 */
	public static void printMenu() {
		System.out.println("****************************");
		System.out.println("***    请输入选择的序号       **");
		System.out.println("******  1  查看学生列表        **");
		System.out.println("******  2  添加学生             **");
		System.out.println("******  3  删除学生             **");
		System.out.println("******  4  修改学生表          **");
		System.out.println("******  5  选课                  **");
		System.out.println("******  6  查询选课信息                  **");
		System.out.println("******  7 退出程序，期待下次再见       **");
		System.out.println("************************");
	}

	public static void printCourse(ArrayList<Course> courseList) {
		if (courseList == null || courseList.size() == 0) {
			System.out.println("课程列表为空");
			return;
		}

		System.out.print("课程ID       课程名          授课老师\n");

		for (int i = 0; i < courseList.size(); i++) {
			Course course = courseList.get(i);
			// 输出每一个数据
			System.out.print(course.getCoureseID() + "   ");
			System.out.print(course.getCoures() + "   ");
			System.out.print(course.getCourseteacher() + "   ");
			System.out.print("\n");
		}

	}

	public static void printScore(ArrayList<Score> scoreList) {
		if (scoreList == null || scoreList.size() == 0) {
			System.out.println("课程列表为空");
			return;
		}

		System.out.print("学生姓名       课程名          成绩\n");

		for (int i = 0; i < scoreList.size(); i++) {
			Score score = scoreList.get(i);
			// 输出每一个数据
			System.out.print(score.getStu_id() + "   ");
			System.out.print(score.getCoures_id() + "   ");
			System.out.print(score.getGrade() + "   ");
			System.out.print("\n");
		}

	}
}
